﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="MyBook.aspx.cs" Inherits="MyBook" Title="猎书网-我的书架" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script language="javascript" src="/model/List.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){   
//选择按钮 
    $("#selectAll").bind("click", function(e){
       $("[name='checkbox']").each(function(){//反选
            if($(this).attr("checked")){
                $(this).removeAttr("checked");
            }
            else{
                $(this).attr("checked",'true');
            }
       });
    });
//下架按钮
    $("#delete").bind("click", function(e){
       var bookids="";
       $("[name='checkbox']").each(function(){
            if($(this).attr("checked")){
             $(this).parent().parent().remove();
                if(bookids=="")
                    bookids+=$(this).val();
                else
                    bookids+="_"+$(this).val();
           }
       });
        $.ajax({ 
            url: 'MyBook.aspx',
            type: 'POST',
            data: { lb: "delete", bookid:bookids},
            dataType: 'html',
            timeout: 1000,
            error: function() { alert('未知错误'); },
            success: function(data) { 
                if(data!="")
                    window.alert(data);
                if(data=="尚未登录")
                    window.location="/Login.aspx";       
        }
        }); 
    });
});   
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <form name="myForm" id="myForm" action="#" method="post">
<table cellspacing="0" cellpadding="0" class="myTable">
<tr>
    <th width="3%">选</th>
    <th width="15%">小说</th>
    <th width="12%">作者</th>
    <th align="center">最新章节</th>
    <th width="10%">更新时间</th>
    <th width="6%">总点击</th>
</tr>
<% Response.Write(WebMake.getBookList(Page.User.Identity.Name));%>
</table>
<div class="space"></div>
<div><input type="button" value="反选" id="selectAll" name="selectAll" />&nbsp;&nbsp;&nbsp;<input type="button" name="delete" id="delete"  value="下架" /></div>
</form>
</asp:Content>

